/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package cn.apestar.modules.report.userreport.service;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.apestar.common.persistence.Page;
import cn.apestar.common.service.CrudService;
import cn.apestar.modules.cache.RemoveCacheUtil;
import cn.apestar.modules.report.userreport.dao.UserReportDao;
import cn.apestar.modules.report.userreport.entity.UserReport;

/**
 * 用户收徒报表管理Service
 * @author yudw
 * @version 2016-10-10
 */
@Service
@Transactional(readOnly = true)
public class UserReportService extends CrudService<UserReportDao, UserReport> {

    public UserReport get(String id) {
        return super.get(id);
    }

    public List<UserReport> findList(UserReport userReport) {
        return super.findList(userReport);
    }

    public Page<UserReport> findPage(Page<UserReport> page, UserReport userReport) {
        return super.findPage(page, userReport);
    }

    @Transactional(readOnly = false)
    public void save(UserReport userReport) {
        super.save(userReport);
    }

    @Transactional(readOnly = false)
    public void delete(UserReport userReport) {
        super.delete(userReport);
        if (userReport != null && !StringUtils.isEmpty(userReport.getId()))
            RemoveCacheUtil.removeUserCache(userReport.getId());
    }

}